package bud.web.boardshop.dao;

import java.util.List;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import bud.vo.BoardFormDTO;
import bud.vo.BoardshopDTO;

public class BoardshopDaoiBatis implements IBoardshopDao{

	private SqlMapClientTemplate mapper;
	
	public SqlMapClientTemplate getMapper() {
		return mapper;
	}

	public void setMapper(SqlMapClientTemplate mapper) {
		this.mapper = mapper;
	}
	
	@Override
	public List<BoardshopDTO> getBoardshopList(BoardFormDTO formDTO) {
		return mapper.queryForList("Boardshop.getBoardshopList", formDTO);
	}

	@Override
	public int getBoardshopCount(BoardFormDTO formDTO) {
		return (Integer) mapper.queryForObject("Boardshop.getBoardshopCount", formDTO);
	}

	@Override
	public BoardshopDTO getBoardshop(Integer bsh_no) {
		return (BoardshopDTO) mapper.queryForObject("Boardshop.getBoardshop", bsh_no);
	}

	@Override
	public int insertBoardshop(BoardshopDTO boardshop) {
		return (int) mapper.insert("Boardshop.insertBoardshop", boardshop);
	}

	@Override
	public int updateBoardshop(BoardshopDTO boardshop) {
		return mapper.update("Boardshop.updateBoardshop", boardshop);
	}

	@Override
	public int deleteBoardshop(Integer bsh_no) {
		return mapper.delete("Boardshop.deleteBoardshop", bsh_no);
	}

}
